import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getAllCategoryAPI } from '@/apis/categoryAPI'

export const useCategoryStore = defineStore('category', () => {

  const categories = ref([])

  const getAllCategory = async () => {
      const response = await getAllCategoryAPI()
      categories.value = response.data 
    }

  return { categories, getAllCategory }
})
